package com.dongdong.controller;


import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.dongdong.service.OSSService;
import com.dongdong.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class OSSController {


    @Autowired
    private OSSService ossService;
    @PostMapping("/uploadFile")
    public Result uploadFile(@RequestBody MultipartFile img){
        return ossService.uploadFile(img);
    }

}
